# -*- coding: utf-8 -*-            
# @Author : HJH
# @Time : 2024/3/2 18:01
# @Use :
import requests
import json


headers = {
    "authority": "www.ceair.com",
    "accept": "application/json, text/plain, */*",
    "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
    "content-type": "application/json;charset=UTF-8",
    "origin": "https://www.ceair.com",
    "referer": "https://www.ceair.com/shopping?eyJ0cmF2ZWxUeXBlIjoib25ld2F5IiwicGFzc2VuZ2VyTnVtIjoiMSwwLDAiLCJkZXBDaXR5IjoiU0hBIiwiYXJyQ2l0eSI6IkNUVSIsImRlcENpdHlOYW1lIjoi5LiK5rW3IiwiYXJyQ2l0eU5hbWUiOiLmiJDpg70iLCJwcm9kdWN0Q29kZSI6IkpIWVgxOCIsImRhdGUiOiIyMDI0LTAzLTAyIiwiZGVwVmFsdWVzIjoiU0hBIiwiYXJyVmFsdWVzIjoiVEZVIiwiZGVwU2VsZWN0VmFsdWUiOiJTSEEiLCJhcnJTZWxlY3RWYWx1ZSI6IlRGVSIsImNhYmluQ2xhc3MiOiJBbGwiLCJwYXlXYXkiOiJtb25leSIsImlzQXJyQ2l0eSI6dHJ1ZSwiaXNEZXBDaXR5Ijp0cnVlfQ==encoded",
    "sec-ch-ua": "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Microsoft Edge\";v=\"122\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "site": "zh_CN",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0",
    "x-tingyun-id": "DuR5xFLm8eI;r=373504060"
}
cookies = {
    "inter": "MWQ2YWE4MTYtNTgxYy00MTk4LTlhZjUtZTliODIyNWE2MzI0",
    "sajssdk_2015_cross_new_user": "1",
    "sensorsdata2015jssdkcross": "%7B%22distinct_id%22%3A%2218dfd4796bce38-0f45abdc5250348-4c657b58-2073600-18dfd4796bd573%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMThkZmQ0Nzk2YmNlMzgtMGY0NWFiZGM1MjUwMzQ4LTRjNjU3YjU4LTIwNzM2MDAtMThkZmQ0Nzk2YmQ1NzMifQ%3D%3D%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%22%2C%22value%22%3A%22%22%7D%2C%22%24device_id%22%3A%2218dfd4796bce38-0f45abdc5250348-4c657b58-2073600-18dfd4796bd573%22%7D",
    "gioCookie": "yes",
    "gr_user_id": "664a9a06-2edf-446f-a1e1-5a1289ddfc4b",
    "arialoadData": "true",
    "ariawapChangeViewPort": "false",
    "ariawapForceOldFixed": "false",
    "acw_tc": "ac11000117093734258108041ee6aa8de053545c66e9d22632c1a4019a0d47",
    "i18n_site": "zh_CN",
    "HMF_CI": "f82339f62237378bec6fdd3e8601c078e01f5c1695c243067d34b879751154648d75ae1dd879e9374ad8d110aca0b3a66c914fe41583828713c5723422beddc232",
    "84bb15efa4e13721_gr_session_id": "e439f585-ca99-4bb8-a0bc-3dfa877f216b",
    "84bb15efa4e13721_gr_session_id_sent_vst": "e439f585-ca99-4bb8-a0bc-3dfa877f216b",
    "HBB_HC": "17c09c81e5337b3325ae66c6d02b2d3eec6482798926a033ce8fb7b83a3354c774dd348cee4bc654ff39ec9fc128ba8d91"
}
url = "https://www.ceair.com/portal/v3/shopping/fareDetail"
data = {
    "cacheKey": "B8E497F5BE1321C9FF861B345E4D423A",
    "itnList": [
        {
            "itnIndex": "1",
            "segInfos": [
                {
                    "segIndex": 1,
                    "oriEng": "SHA",
                    "desEng": "TFU",
                    "fltDate": "2024-03-04",
                    "depTime": "17:30",
                    "arrTime": "20:25",
                    "carrier": "MU",
                    "carrier_o": "MU",
                    "flightNo_o": "9185",
                    "flightNo": "9185",
                    "diType": "D",
                    "classLevel": "",
                    "classCode": "",
                    "allCabins": "DEBCLMNOHJKTVQSRYXZ",
                    "planType": "919"
                }
            ]
        }
    ],
    "flightFareIdList": [
        "A04D93A1B69C272DAFD210B165D874CD-B8E497F5BE1321C9FF861B345E4D423A"
    ],
    "cabinCode": "T",
    "cabinLevel": "Y",
    "flightInfoIdList": [
        "20240304SHATFUMU9185"
    ],
    "priceSource": "STANDARD",
    "productCode": "JHYX18",
    "currency": "CNY",
    "departDateTime": "2024-03-04 17:30",
    "orgCode": "SHA",
    "airlineCode": "MU",
    "routeType": "OW",
    "domesticOrInter": "D",
    "ifReschedule": "0",
    "segNum": 1,
    "passengerCount": "1,0,0",
    "sequenceId": "1",
    "foldingFlag": "1"
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, cookies=cookies, data=data)

print(response.text)
print(response)